<?php
class Application_Form_Login extends Zend_Form  {

	public function init(){
		$this->setName('login');
		$this->setMethod("post");

		$this->addElement("text", 'email', array(
	            'label'      => 'Email:',
	            'required'   => true,
	            'filters'    => array('StringTrim','StripTags'),
	            'validators' => array(
	                'EmailAddress',
	            	'NotEmpty'
	            )
        ));

		$password = new Zend_Form_Element_Password('password');
		$password->setLabel('Password:')
		->setRequired(true)
		->addFilter('StripTags')
		->addFilter('StringTrim');
		

		$submit = new Zend_Form_Element_Submit('submit');
		$submit->setAttrib('id', 'submitbutton')
		->setLabel('Log in');

		$elements = array($password, $submit);
		$this->addElements($elements);
	
		$this->setDecorators( array( array('ViewScript', array('viewScript' => 'login/loginform.phtml'))));
		//$this->setDecorators( array('Composite'));
	}

}